#ifndef BASICS_MAP_H
#define BASICS_MAP_H
//#include "stdafx.h"
using namespace std;

class Basics_map
{
public:
	template <typename T,typename U > static int get_keys(map <T,U> &val,vector <T> &key_id)
	{
		typename map < T,U >::const_iterator it;
		for(it=val.begin();it!=val.end();it++){
			key_id.push_back(it->first);
		}
		return 0;
	}
	template <class T,class U> static int check_for_keys(const map<T,U> &val,const vector <T> &key_id)
	{
		unsigned int row;
		int dec=0;
		for(row=0;row<key_id.size();row++){
			if(val.find(key_id[row])!=val.end())dec++;
		}
		return dec;
	}
	template <class T,class U > static int set_key(map <T,U > &val,vector<T> keys,U nulldat)
	{
		//extends te keys by entries of vector;
		//if keys already exist give error message;
		unsigned int row;
		if (check_for_keys(val,keys)>0) {
			err::err3("Basics_map::set_keys: at least one of the keys already declared in map.");
			return 1;
		}
		for(row=0;row<keys.size();row++)
		{
			val[keys.at(row)]=nulldat;
		}
		return 0;
	}
};

#endif